import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import VueFullpage from '@/assets/vue-fullpage/index.js';
import '@/assets/vue-fullpage/vue-fullpage.css';
import 'animate.css';

Vue.use(ElementUI);
Vue.use(VueFullpage);

Vue.directive('animate', {
  inserted: function (el, binding, vnode) {
    let vm = vnode.context;
    vm.$root.eventBus.$on("toggle-animate", (curPage) => {
      if (curPage === binding.value.page) {
        el.className = binding.value.className;
      } else {
        el.className = "";
      }
    });
  }
});

Vue.config.productionTip = false

new Vue({
  data:{
    eventBus: new Vue()
  },
  router,
  render: h => h(App)
}).$mount('#app')
